<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="Step 2: Setting the Redo Log Mode">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="gaussdbT_00010.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
  <meta name="DC.Publisher" content="20241029">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="gaussdbT_00071">
  <meta name="DC.Language" content="en-us">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>Step 2: Setting the Redo Log Mode</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="gaussdbT_00071"></a><a name="gaussdbT_00071"></a>
  <h1 class="topictitle1">Step 2: Setting the Redo Log Mode</h1>
  <div>
   <p id="gaussdbT_00071__en-us_topic_0000001737511009_p173691841194416">Redo logs can be saved in <strong id="gaussdbT_00071__en-us_topic_0000001737511009_b132459218161">ARCHIVELOG</strong> or <strong id="gaussdbT_00071__en-us_topic_0000001737511009_b43121056164">NOARCHIVELOG</strong> mode.</p>
   <ul id="gaussdbT_00071__en-us_topic_0000001737511009_ul72323392273">
    <li id="gaussdbT_00071__en-us_topic_0000001737511009_li2784136258">Archiving mode (<strong id="gaussdbT_00071__en-us_topic_0000001737511009_b197809152026">ARCHIVELOG</strong>)<p id="gaussdbT_00071__en-us_topic_0000001737511009_p1733619164252">When the size of a redo log file reaches the maximum, the system copies the log content to the archive log file for unified storage, which prevents the content from being overwritten by next write.</p></li>
    <li id="gaussdbT_00071__en-us_topic_0000001737511009_li62321339132719">Online mode (<strong id="gaussdbT_00071__en-us_topic_0000001737511009_b936320201825">NOARCHIVELOG</strong>)<p id="gaussdbT_00071__en-us_topic_0000001737511009_p82327392274">When the redo log file is full, no backup is performed. The log content will be overwritten by next write.</p></li>
   </ul>
   <div class="section" id="gaussdbT_00071__en-us_topic_0000001737511009_section18617501568">
    <h4 class="sectiontitle">Procedure</h4>
    <ol id="gaussdbT_00071__en-us_topic_0000001737511009_ol2032185720616">
     <li id="gaussdbT_00071__en-us_topic_0000001737511009_li1532125711614"><span>Connect to the Gauss100 OLTP server.</span></li>
     <li id="gaussdbT_00071__en-us_topic_0000001737511009_li192071621198"><a name="gaussdbT_00071__en-us_topic_0000001737511009_li192071621198"></a><a name="en-us_topic_0000001737511009_li192071621198"></a><span>Run the following SQL statement to query the current log mode:</span><p></p><pre class="screen" id="gaussdbT_00071__en-us_topic_0000001737511009_screen8702185112101">SELECT LOG_MODE FROM DV_DATABASE;</pre> <p></p></li>
     <li id="gaussdbT_00071__en-us_topic_0000001737511009_li1397917475106"><span>If the redo log archive mode queried in <a href="#gaussdbT_00071__en-us_topic_0000001737511009_li192071621198">2</a> needs to be changed, run the following SQL statement to change the redo log mode. The following statement is an example.</span><p></p><pre class="screen" id="gaussdbT_00071__en-us_topic_0000001737511009_screen8424123342012">ALTER DATABASE ARCHIVELOG;</pre> <p></p></li>
     <li id="gaussdbT_00071__en-us_topic_0000001737511009_li475522732016"><span>After the change is complete, perform <a href="#gaussdbT_00071__en-us_topic_0000001737511009_li192071621198">2</a> to check whether the change is successful.</span></li>
    </ol>
    <div class="note" id="gaussdbT_00071__en-us_topic_0000001737511009_note4845115014255">
     <img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span>
     <div class="notebody">
      <ul id="gaussdbT_00071__en-us_topic_0000001737511009_ul1218476112617">
       <li id="gaussdbT_00071__en-us_topic_0000001737511009_li15184146192610">If a database is deployed in active/standby mode, you can set the redo log mode only to <strong id="gaussdbT_00071__en-us_topic_0000001737511009_b176469211157">ARCHIVELOG</strong> instead of <strong id="gaussdbT_00071__en-us_topic_0000001737511009_b1518534135814">NOARCHIVELOG</strong>.</li>
       <li id="gaussdbT_00071__en-us_topic_0000001737511009_li176181498269">Gauss100 OLTP is in archive mode by default.</li>
      </ul>
     </div>
    </div>
   </div>
   <p id="gaussdbT_00071__en-us_topic_0000001737511009_p8060118"></p>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>Parent topic:</strong> <a href="gaussdbT_00010.html">Backing Up a GaussDB T Database</a>
    </div>
   </div>
  </div>
 </body>
</html>